// ObjectList.h: interface for the ObjectList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OBJECTLIST_H__24E3D4F6_8CEB_468D_B1F1_FC2B138A0A2C__INCLUDED_)
#define AFX_OBJECTLIST_H__24E3D4F6_8CEB_468D_B1F1_FC2B138A0A2C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
#include <plib/ul.h>
#include <plib/sg.h>
#include <plib/ssg.h>

#define TREE_LIST		0
#define BUILDING_LIST	1
#define TEXTURE_LIST	2
#define FACILITY_LIST   3

#define OBJECT_TYPE_TREE_0	   0
#define OBJECT_TYPE_BUILDING_0 1
#define OBJECT_TYPE_TEXTURE_0  2
#define OBJECT_TYPE_FACILITY_0 3

#define TREE_KIND_0			   0 

#define BUILDING_KIND_0		   0

#define TEXTURE_KIND_0		   0

struct ObjectSlot
{
	int type;
	int kind;
	int code; // object unique identifier
	ssgTransform* t;
	float x; 
	float y;
	float z;
	float h;
	float p;
	float r;
};

class ObjectList  
{
public:
	ObjectList();
	virtual ~ObjectList();

	int add(ssgTransform* t, int type, int kind, float x, float y, float z);
	int add(ssgTransform* t, int type, int kind, float x, float y, float z, float h, float p, float r);
	int add(int type, int kind, float x, float y, float z, float h, float p, float r);
	ObjectSlot* get(int p);
	int set(int pos, float x, float y, float z, float h, float p, float r);
	void set(ssgTransform* t, int i);
	void fprint(FILE* f);
	void load(FILE* f);
	void remove(ssgTransform* t);
	int getSize();

private:
	ulLinkedList *list;
};

#endif // !defined(AFX_OBJECTLIST_H__24E3D4F6_8CEB_468D_B1F1_FC2B138A0A2C__INCLUDED_)
